use axum::{
    Router,
    routing::{get, put},
};
use sqlx::MySqlPool;
use crate::handlers::item;

pub fn routes(pool: MySqlPool) -> Router {
    Router::new()
        .route("/tables/:table_name/items", get(item::get_items).post(item::create_item))
        .route("/tables/:table_name/items/:id", put(item::update_item).delete(item::delete_item))
        .with_state(pool)
}